<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>
			Document
		</title>
		<script type='text/javascript' src='http://localhost/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = '<?php echo $GLOBALS['user']['HOST'];?>';
ROOT = '<?php echo $GLOBALS['user']['ROOT'];?>';
WEB = '<?php echo $GLOBALS['user']['WEB'];?>';
URL = '<?php echo $GLOBALS['user']['URL'];?>';
APP = '<?php echo $GLOBALS['user']['APP'];?>';
COMMON = '<?php echo $GLOBALS['user']['COMMON'];?>';
HDPHP = '<?php echo $GLOBALS['user']['HDPHP'];?>';
HDPHPDATA = '<?php echo $GLOBALS['user']['HDPHPDATA'];?>';
HDPHPEXTEND = '<?php echo $GLOBALS['user']['HDPHPEXTEND'];?>';
MODULE = '<?php echo $GLOBALS['user']['MODULE'];?>';
CONTROLLER = '<?php echo $GLOBALS['user']['CONTROLLER'];?>';
ACTION = '<?php echo $GLOBALS['user']['ACTION'];?>';
STATIC = '<?php echo $GLOBALS['user']['STATIC'];?>';
HDPHPTPL = '<?php echo $GLOBALS['user']['HDPHPTPL'];?>';
VIEW = '<?php echo $GLOBALS['user']['VIEW'];?>';
PUBLIC = '<?php echo $GLOBALS['user']['PUBLIC'];?>';
CONTROLLERVIEW = '<?php echo $GLOBALS['user']['CONTROLLERVIEW'];?>';
HISTORY = '<?php echo $GLOBALS['user']['HISTORY'];?>';
</script>
	</head>
	<body>
		<div class="wrap">
			<div class="menu_list">
				<ul>
					<li>
						<a href="<?php echo U('index');?>"  class="action">
							栏目列表
						</a>
					</li>
				</ul>
			</div>
			<div class="title-header" >
				添加栏目
			</div>
			<form action="" method="post" class="hd-form">
				<table class="table1">
					<tr>
						<th class="w100">商品类型</th>
						<td>
							<select name="gtid">
							<?php $hd["list"]["c"]["total"]=0;if(isset($goods_type) && !empty($goods_type)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($goods_type));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($goods_type,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

								<option value="<?php echo $c['gtid'];?>"><?php echo $c['gt_name'];?></option>
							<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</select>
						</td>
					</tr>
					<tr>
						<th class="w100">父级</th>
						<td>
							<select name="pid">
								<option value="0">==顶级==</option>
								<?php $hd["list"]["c"]["total"]=0;if(isset($category) && !empty($category)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($category));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($category,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

									<option value="<?php echo $c['cid'];?>" <?php if($c['cid'] == $_GET['pid']){?>selected=""<?php }?>><?php echo $c['_name'];?></option>
								<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</select>
						</td>
					</tr>
					<tr>
						<th>
							栏目名称
						</th>
						<td>
							<input type="text" name='catname' class="w200"/>
						</td>
					</tr>
					<tr>
						<th>
							类型
						</th>
						<td>
							<input type="radio" name='cattype' value="1" /> 封面栏目
							<input type="radio" name='cattype' value="2" checked=""/> 普通栏目
						</td>
					</tr>
					<tr>
						<th>
							价格区间
						</th>
						<td>
							<input type="text" name='price_range' value="3" class="w200" />
						</td>
					</tr>
					<tr>
						<th>
							关键字
						</th>
						<td>
							<input type="text" name='cat_keywords' class="w200" />
						</td>
					</tr>
					<tr>
						<th>
							描述
						</th>
						<td>
							<textarea name="cat_description" class="w300 h100"></textarea>
						</td>
					</tr>
				</table>
				<div class="position-bottom">
					<input type="submit" class="hd-success" />
				</div>
			</form>
		</div>
		<script>
		$('form').validate({
	gt_name: {
			rule: {
				required: true
			},
			error: {
				required: '不能为空'
			}
		}
	})
</script>
	</body>
</html>
